#pragma once
#include <GdiPlus.h>
using namespace Gdiplus;

#include "UIManager.h"
#pragma warning(push)
#pragma warning(disable:4251)

#include <vector>
#include <map>
using namespace std;

#include "CoolUIDefine.h"

class COOLUI_CLASS CUIManagerImpl : public CUIManager
{
public:
    CUIManagerImpl();

    virtual ~CUIManagerImpl();

    CUIImgInterface* CreateUIImgRender();

    CUILayout* CreateUILayout();

    static CUIWindow* SkinWnd( HWND hWnd );

    static void UnSkinWnd( HWND hWnd );

    static CUIWindow* FromeHandle( HWND hWnd );

    static BOOL HookWindow( CUIWindow* pWnd );

    static void UnHookWindow( CUIWindow* pWnd );

    static CUIWindow* CreateUIWindow( HWND hWnd );

    static void RegisterWindowClass( LPCTSTR lpszWndClassName );

    static void RegisterAllWindowClass();

    static BOOL WindowClassRegistered( LPCTSTR lpszClassName );

    static void Init();

    static void UnInit();

private:
    static UINT NewWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );

    static map<HWND, CUIWindow*> m_WindowObjMap;

    static vector<LPCTSTR> m_RegisterWndClassMap;

    static GdiplusStartupInput    m_Gdistart;

    static ULONG_PTR    m_GdiplusToken;
};

#pragma warning(pop)